Skip to content

os/arch/arm/src/armino:Add hash verification for the public key - #7588

Open
xiaotao-yuan wants to merge 2 commits into
Samsung:masterfrom
bekencorp:secu_verify
Open

xiaotao-yuan wants to merge 2 commits into
Samsung:masterfrom
bekencorp:secu_verify

Conversation

@xiaotao-yuan

@xiaotao-yuan xiaotao-yuan commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

When the kernel verifies the signatures of other images, it uses the public key stored in the image and lacks a validity check for that public key; Therefore, the submission compared the hash of the public key with the hash stored in the OTP, adding a check for the legality of the public key,and also update tfm binary files.

Tested on BK7239N xip_all : secure boot and OTA functionality were tested and work properly.

@xiaotao-yuan
xiaotao-yuan force-pushed the secu_verify branch 3 times, most recently from 12e594d to ff9b48f Compare October 29, 2026 03:33
@jeongarmy

Copy link
Copy Markdown
Contributor

Please resolve conflicts,

@xiaotao-yuan
xiaotao-yuan force-pushed the secu_verify branch 2 times, most recently from 4a60fd7 to aa343b2 Compare November 17, 2026 12:58
Signed-off-by: xiaotao.yuan <xiaotao.yuan@aclsemi.com>
Add an API that provides public key hash verification for non secure worlds

Signed-off-by: xiaotao.yuan <xiaotao.yuan@aclsemi.com>
@xiaotao-yuan

Copy link
Copy Markdown
Contributor Author

Please resolve conflicts,

I have updated the PR, please continue to review, thank you。

@seokhun-eom24

Copy link
Copy Markdown
Contributor

🤖 AI Code Review · 59ffb2d23e64

PR Summary: The PR adds a new secure-side API bk_otp_verify_pubkey_hash_nsc for verifying public key hashes and fixes a build issue by prioritizing the non-secure board include path. The new API documents return constants that are not defined anywhere in the repository, which will break non-secure callers expecting to check the return value.

📋 Findings Overview (1 issue)

Severity Category Issue Location
🟠 Medium Correctness Missing definitions for bk_otp_verify_pubkey_hash_nsc return values tfm_otp_nsc.h:84

✅ Checked with no findings: Memory Leaks, Crashes, Hangs


🔍 Details & Suggested Fixes

1. [Correctness] Missing definitions for bk_otp_verify_pubkey_hash_nsc return values
  • Location: os/board/bk7239n/src/components/tfm/tfm_loadable_build/tfm_install/interface/include/tfm_otp_nsc.h#L84
  • Evidence: The newly added bk_otp_verify_pubkey_hash_nsc documents return constants such as TFM_OTP_PUBKEY_HASH_MATCH and TFM_OTP_PUBKEY_HASH_MISMATCH, but these macros or enums are not defined anywhere in the repository. Non-secure callers that include this header and check the return value against these names will fail to compile.
  • Suggested fix: Define the return constants (e.g., via an enum or #define) in tfm_otp_nsc.h or a commonly included header before the function declaration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants